﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Tomato.Serialization
{
    public abstract class Deserializer
    {
        public abstract T Deserialize<T>(Stream stream);

        public T Deserialize<T>(string s)
        {
            using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(s)))
            {
                return Deserialize<T>(stream);
            }
        }
    }
}
